package day124;

public class RegDemo10 {
    public static void main(String[] args) {
        /*
        测试 如何匹配 域名www.tedu.com
        *必须使用正则表达式www\.tedu\.com
        *.表示任意字符
        *如果匹配点就需要\.
         */
        //定义正则表达式
        String reg1="www.tedu.com";
        String reg2="www\\.tedu\\.com";
        String s1="www.tedu.com";
        String s2="wwwAteduAcom";
        String s3="www-tedu-com";
        System.out.println(s1.matches(reg1));
        System.out.println(s2.matches(reg1));
        System.out.println(s3.matches(reg1));

        System.out.println(s1.matches(reg2));
        System.out.println(s2.matches(reg2));
        System.out.println(s3.matches(reg2));

    }
}
